<template>
  <view>
    <view class="TabBarBox">
      <TabBar :type="type" @onClickItem="onClickItem"></TabBar>
    </view>
    <view class="content">
      <template v-if="current === 0">
        <InfoPanel title="已预约" :testDriveList="testDriveList" type="保养">
          <text class="date">预约时间：{{ itme.createTime }}</text>
        </InfoPanel>
        <u-empty mode="search" text="预约保养为空" v-if="!testDriveList.length"
          icon="https://www.kamlung.net/images/other/search1.png">
        </u-empty>
        <uni-load-more :status="status" v-if="testDriveList.length > 10" />
      </template>
      <template v-if="current === 1">
        <InfoPanel title="已结束" :testDriveList="testDriveList" type="保养">
          <text class="date">预约时间：{{ itme.createTime }}</text>
        </InfoPanel>
        <u-empty mode="search" text="已完成预约保养为空" v-if="!testDriveList.length"
          icon="https://www.kamlung.net/images/other/search1.png">
        </u-empty>
        <!-- <uni-load-more :status="status" v-if="testDriveList.length > 10" /> -->
      </template>
      <!-- <template v-if="current === 2">
        <InfoPanel title="已取消" :testDriveList="testDriveList">
          <text class="date">申请时间：{{ itme.createTime }}</text> 
        </InfoPanel>
        <uni-load-more :status="status" />
      </template> -->
    </view>
  </view>
</template>

<script>
import { carAppointListMixin } from '@/mixins/mixins'
export default {
  mixins: [carAppointListMixin], // 混入
  data() {
    return {
      type: 'M',
    }
  },
  onLoad() {
    // 混合分享信息
    this.shareMixin.title = `保养列表`
    this.shareMixin.path = `/pages/CarMaintain/CarMaintain`
    // 是否登录
    if (!Object.keys(this.loginInfo).length) {
      this.$refs.openLogin.isShow()
      return false
    }
  },
}
</script>

<style lang="scss">
page {
  background: #fafafa;
}
</style>
<style lang="scss" scoped>
.TabBarBox {
  width: 100%;
  position: fixed;
  left: 0;
  top: 0;
}

.content {
  margin-top: 75px;
  padding-bottom: 30px;
}
</style>
